<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%
    String path = request.getContextPath();
    String basepath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            background: url('https://cdn.pixabay.com/photo/2018/08/14/13/23/ocean-3605547_1280.jpg') no-repeat;
            background-size: 100% 130%;
        }

         btn{
             text-align: center;
             padding: 5px;
             width: 7%;
             margin-top: 40px;
             background-image: linear-gradient(to right, #a6c1ee, #fbc2eb);
         }


        #login_box {
            width: 20%;
            height: 400px;
            background-color: #00000060;
            margin: auto;
            margin-top: 10%;
            text-align: center;
            border-radius: 10px;
            padding: 50px 50px;
        }

        h2 {
            color: #ffffff90;
            margin-top: 5%;
        }

        #input-box {
            margin-top: 5%;
        }

        span {
            color: #fff;
        }

        input {
            border: 0;
            width: 60%;
            font-size: 15px;
            color: #fff;
            background: transparent;
            border-bottom: 2px solid #fff;
            padding: 5px 10px;
            outline: none;
            margin-top: 10px;
        }

        button {
            margin-top: 50px;
            width: 60%;
            height: 30px;
            border-radius: 10px;
            border: 0;
            color: #fff;
            text-align: center;
            line-height: 30px;
            font-size: 15px;
            background-image: linear-gradient(to right, #30cfd0, #330867);
        }

        #sign_up {
            margin-top: 45%;
            margin-left: 60%;
        }

        a {
            color: #b94648;
        }
    </style>
</head>

<body>
<div id="login_box">
    <h2 style="color: #61dafb">注册页面</h2>
    <span  style="color: #b94648" id="zuce"> </span>
    <form action="${pageContext.request.contextPath}/account/signUp" method="post">
    <div id="input_box">
        <input type="text" name="username" placeholder="请输入用户名" required >
    </div>
    <div class="input_box">
    <input type="text" name="password" placeholder="请输入密码" required id="mm1">
    </div>
    <div class="input_box">
        <input type="text"  placeholder="请再次输入密码" required id="mm2">
    </div>
<%--   onclick="return check1()点击事件返回值false不提交，true提交     --%>
        <button type="submit" id="btn" onclick="return check1()">注册</button><br>

    </form>
    <br>

    <div class="row">
        <div class="col-md-4 column">
            <a class="btn btn-primary"  href="${pageContext.request.contextPath}/index.jsp">返回登录界面</a>
        </div>
    </div>
</div>

<script type="text/javascript">
//判断两次密码是否一致
function check1() {
    var name1 = document.getElementById("mm1").value;
    var name2 = document.getElementById("mm2").value;
    if (name1 != name2) {
        document.getElementById("zuce").innerText="两次密码不一致"
        return false;
    }
    return true;
}
</script>

<%--密码判断--%>
</body>
</html>
